pub fn convert_base(num_str: &str, to_base: u32) -> String {
    let num = &num_str[0..num_str.find("(").unwrap()];
    let base: u32 = num_str[num_str.find("(").unwrap()+1..num_str.len()-1].parse().unwrap();
    let mut ten_num = 0;
    for (i, char) in num.chars().enumerate() {
        if char.is_ascii_digit() {
            ten_num += (char as u32 - '0' as u32) * base.pow((num.len() - i - 1) as u32);
        } else if char.is_ascii_lowercase() {
            ten_num += (char as u32 - 'a' as u32 + 10) * base.pow((num.len() - i - 1) as u32);
        } else if char.is_ascii_uppercase() {
            ten_num += (char as u32 - 'A' as u32 + 36) * base.pow((num.len() - i - 1) as u32);
        }
    }
    if to_base != 10 {
        let mut res = Vec::new();
        while ten_num != 0 {
            let tmp = (ten_num % to_base) as u8;
            if tmp >= 36 {
                res.push((tmp - 36 + 65) as char);
            } else if tmp >= 10 {
                res.push((tmp - 10 + 97) as char);
            } else {
                res.push((tmp + 48) as char);
            }
            ten_num = ten_num / to_base;
        }
        res.iter().rev().collect::<String>()
    } else {
        ten_num.to_string()
    }
}
